#include <iostream>
 
#include "sxcom.h"

#define MYID 2


using namespace std;
int main()
{
	int fileDesc = initSXCOM(MYID); 
	if(fileDesc >= 0)
	{
		while(1)
		{
			//cout << serialDataAvail(fileDesc);
			//cout << "in infLoop" << endl; 
			uint8_t size=0; 
			uint8_t * message = NULL;
			message = msgRec(&size); 
			if(message != NULL){
				//coVut << "NULL";
				cout << (char*)message << endl; 
			}
			
		}			
	}else{
		cout << "Could not open Serial" << endl; 
		return -1;
	}
	return 0; 
}
